#include <stdio.h>

/* 算法3-14：阶乘的递归实现 Factorial(n) */
int Factorial(int n) {
    if (n <= 0) {
        return 1;
    } else {
        return (n * Factorial(n - 1));
    }
}
/* 算法3-14 结束 */

int main(void) {
    int n;

    scanf("%d", &n);
    printf("%d\n", Factorial(n));
    return 0;
}